<?php
/**
 * Created by swagger_zxd.
 * User: zxd
 * Date: 2017/11/30
 * Time: 10:30
 */

namespace App\Listeners;


class UserEventSubscriber
{
    /**
     * 处理登陆事件
     * @param $event
     */
    public function onUserLogin($event)
    {

    }

    /**
     * 处理用户推出事件
     * @param $event
     */
    public function onUserLogout($event)
    {

    }

    /**
     * 为订阅者注册监听器
     * @param $events
     */
    public function subscribe($events)
    {
        $events->listen(
            'Illuminate\Auth\Events\Login',
            'App\Listeners\UserEventSubscriber@onUserLogin'
        );
        $events->listen(
            'Illuminate\Auth\Events\Logout',
            'App\Listeners\UserEventSubscriber@onUserLogout'
        );
    }
}